/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package UI;

import java.lang.String;
import java.util.List;
import javax.swing.table.AbstractTableModel;
import msncommonsc.GuardarC;

/**
 *
 * @author Agustin
 */
public class msnTableModelCombersaciones extends AbstractTableModel {

    public Object[][] cargarRegitros() {

        try {
            List<String> registros2 = GuardarC.getInstance().leerLog("registro.txt");
            registros = new String[registros2.size()][1];

            for (int x = 0; x < registros2.size(); x++) {
                registros[x][0] = registros2.get(x);
            }
        } catch (Exception e) {
            throw new UnsupportedOperationException(e.toString());
        }

        return registros;
    }
    private Object registros[][] = cargarRegitros();

    public Object[][] getRegistros() {
        return registros;
    }

    public void setRegistros(Object[][] registros) {
        this.registros = registros;
    }

    public int getRowCount() {
        if (registros.length == 0) {
            return 0;
        } else {
            return registros.length;

        }
    }

    public int getColumnCount() {
        if (registros.length == 0) {
            return 0;
        } else {
            return registros[0].length;

        }

    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        Object r = new String();
        r = getRegistros()[rowIndex][columnIndex];
        return r;

    }
}
